<%-- 
    Document   : home
    Created on : 28 mai 2009, 21:15:00
    Author     : hoby
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Travel Home Page</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<f:view>
<div id="page">

<jsp:include page="frame.jsp" />

	<!-- le corps de la page à 600px -->
	<div id="center"><img src="banniere.gif" width="600" /> <h:form>
		<table id="ver-minimalist" width="600">
			<thead>
				<tr>
					<th>Composez votre voyage</th>
					<th>Choisissez votre destination</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td rowspan="5">
					<ol type="1">
						<li>choisissez votre destination</li>
						<li>Ajoutez des voyageurs</li>
						<li>Selectionnez votre vol</li>
						<li>Selectionnez votre hotel</li>
						<li>Selectionnez votre hotel</li>
					</ol>
					</td>
					<td>Ville de départ</td>
				</tr>
				<tr>
					<td align="right"><h:selectOneMenu
						value="#{commandeBean.idVilleDepart}" title="villeDepart">
						<f:selectItem itemLabel="Selectionnez ..." itemValue="0" />
						<f:selectItems value="#{villeBean.villes}" />
					</h:selectOneMenu></td>
				</tr>
				<tr>
					<td>Ville de destination</td>
				</tr>
				<tr>
					<td align="right"><h:selectOneMenu
						value="#{commandeBean.idVilleDestination}" title="villeDestination">
						<f:selectItem itemLabel="Selectionnez ..." itemValue="0" />
						<f:selectItems value="#{villeBean.villes}" />
					</h:selectOneMenu></td>
				</tr>
				<tr>
					<td align="right">
					<h:commandButton action="#{commandeBean.selectionVilles}" value="Valider" >
						
					</h:commandButton> 
					</td>
				</tr>
			</tbody>
		</table>
	</h:form>
	<span class="texteAMoi">Vos réservations : récapitulatif de votre commande</span>
	<c:if test="${reservationBean.reservations != null}">
	<h:dataTable value="#{reservationBean.reservations}" var="reservation" styleClass="rounded-corner">
			<h:column>
				<h:outputText value="#{reservation.dateDepart}" >
					<f:convertDateTime type="date" dateStyle="short"/>
				</h:outputText>
			</h:column>
			<h:column>
				<h:outputText value="#{reservation.dateRetour}" >
					<f:convertDateTime type="date" dateStyle="short"/>
				</h:outputText>
			</h:column>
			<h:column>
				<h:outputText value="#{reservation.nbPersonne}"/>
			</h:column>
			<h:column>
				<h:outputText value="#{reservation.prix}" />
			</h:column>
			<h:column><h:form>
				<h:commandLink action="#{reservationBean.deleteReservation}">
					<h:outputText value="supprimer" style="rounded-corner" />
					<f:setPropertyActionListener  value="#{reservation.id}" target="#{commandeBean.reservationToDelete}"/>
				</h:commandLink>
			</h:form>
			</h:column>
			<h:column><h:form>
				<h:commandLink action="#{reservationBean.modifyReservation}">
					<h:outputText value="supprimer" style="rounded-corner" />
					<f:setPropertyActionListener  value="#{reservation.id}" target="#{commandeBean.reservationToModify}"/>
				</h:commandLink>
			</h:form>
			</h:column>
		</h:dataTable>
	</c:if>
	<c:else test="${reservationBean.reservations == null}"><span class="texteAMoi">Vous n'avez aucune réservation</span></c:else>
	</div>
	</div>
</f:view>
</body>
</html>

